home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / golf / about.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-04-02  |  4.9 KB  |  143 lines

  1. VERSION 2.00
  2. Begin Form frmAboutGolf 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "About Golf"
  6.    ClientHeight    =   3570
  7.    ClientLeft      =   1440
  8.    ClientTop       =   1875
  9.    ClientWidth     =   6615
  10.    Enabled         =   0   'False
  11.    Height          =   3975
  12.    Left            =   1380
  13.    LinkTopic       =   "Form2"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3570
  17.    ScaleWidth      =   6615
  18.    Top             =   1530
  19.    Width           =   6735
  20.    Begin CommandButton btnHints 
  21.       Caption         =   "Hints"
  22.       Height          =   315
  23.       Left            =   4860
  24.       TabIndex        =   4
  25.       Tag             =   "/3d_inset/"
  26.       Top             =   720
  27.       Width           =   1515
  28.    End
  29.    Begin CommandButton btnCustomizing 
  30.       Caption         =   "Customizing"
  31.       Height          =   315
  32.       Left            =   4860
  33.       TabIndex        =   3
  34.       Tag             =   "/3d_inset/"
  35.       Top             =   1200
  36.       Width           =   1515
  37.    End
  38.    Begin CommandButton btnHowToPlay 
  39.       Caption         =   "How To Play"
  40.       Height          =   315
  41.       Left            =   4860
  42.       TabIndex        =   2
  43.       Tag             =   "/3d_inset/"
  44.       Top             =   240
  45.       Width           =   1515
  46.    End
  47.    Begin CommandButton btnCancel 
  48.       Caption         =   "Back To Game"
  49.       Height          =   315
  50.       Left            =   4860
  51.       TabIndex        =   1
  52.       Tag             =   "/3d_inset/"
  53.       Top             =   3000
  54.       Width           =   1515
  55.    End
  56.    Begin TextBox txtHelp 
  57.       Enabled         =   0   'False
  58.       Height          =   3075
  59.       Left            =   180
  60.       MultiLine       =   -1  'True
  61.       ScrollBars      =   2  'Vertical
  62.       TabIndex        =   0
  63.       Tag             =   "/3d_inset/"
  64.       Top             =   240
  65.       Width           =   4395
  66.    End
  67.    Begin Image Image1 
  68.       Height          =   480
  69.       Left            =   5400
  70.       Picture         =   ABOUT.FRX:0000
  71.       Tag             =   "/3d_raised/"
  72.       Top             =   1980
  73.       Width           =   480
  74.    End
  75. Option Explicit
  76. '------------------------------------------------------------
  77. ' Constants and functions used in by ABOUT.FRM.
  78. '------------------------------------------------------------
  79. Const WM_USER = &H400
  80. Const EM_SETREADONLY = (WM_USER + 31)
  81. Declare Function SendMessage Lib "User" (ByVal hWnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Any) As Long
  82. Sub btnCancel_Click ()
  83. '------------------------------------------------------------
  84. ' Exit this form.
  85. '------------------------------------------------------------
  86.     Unload Me
  87. End Sub
  88. Sub btnCustomizing_Click ()
  89. '------------------------------------------------------------
  90. ' Display the Customization help information.
  91. '------------------------------------------------------------
  92.     DisplayHelp "CUSTOMIZ.TXT"
  93. End Sub
  94. Sub btnHints_Click ()
  95. '------------------------------------------------------------
  96. ' Display the Hints help information.
  97. '------------------------------------------------------------
  98.     DisplayHelp "HINTS.TXT"
  99. End Sub
  100. Sub btnHowToPlay_Click ()
  101. '------------------------------------------------------------
  102. ' Display the How-To help information.
  103. '------------------------------------------------------------
  104.     DisplayHelp "HOWTO.TXT"
  105. End Sub
  106. Sub DisplayHelp (AFile As String)
  107. '------------------------------------------------------------
  108. ' Display a particular help file in the control txtHelp.
  109. '------------------------------------------------------------
  110.     txtHelp = ReadFile(AppPath & AFile)
  111. End Sub
  112. Sub Form_Load ()
  113. '------------------------------------------------------------
  114. ' When the form is loaded, make the text box read-only, and
  115. ' display the How-To help information.
  116. '------------------------------------------------------------
  117. Dim rc As Long
  118.     CenterForm Me
  119.       
  120.     ' Set the text box to read-only mode:
  121.     rc = SendMessage(txtHelp.hWnd, EM_SETREADONLY, True, 0&)
  122.     btnHowToPlay_Click
  123. End Sub
  124. Sub Form_Paint ()
  125. '----------------------------------------------------------------------
  126. ' Put a 3D border around any control tagged "/3D_INSET/" or "/3D_RAISED/.
  127. '----------------------------------------------------------------------
  128.     Paint3D Me
  129. End Sub
  130. Function ReadFile (ByVal Filename As String) As String
  131. '------------------------------------------------------------
  132. ' Read an entire file into a text string.
  133. '------------------------------------------------------------
  134. Dim fnum As Integer
  135. Dim AStr As String
  136.     fnum = FreeFile
  137.     Open Filename For Binary As fnum
  138.     AStr = String$(LOF(fnum), " ")
  139.     Get #fnum, , AStr
  140.     Close fnum
  141.     ReadFile = AStr
  142. End Function
  143.